-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes the onUnhandledRequest
middleware option
#740
Conversation
BREAKING CHANGE: middleware only and (always) handles requests at `path`
Test failures are unrelated to this PR. They should have been caught in #732 |
Should we add that to the README? |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Thanks! I’ve fixed that. |
74f1421
to
453f55b
Compare
🎉 This PR is included in version 11.0.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 10.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* refactor(middleware)!: remove onUnhandledRequest middleware option BREAKING CHANGE: middleware only and (always) handles requests at `path` * build(deps): lock file maintenance (#742) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(doc): document way to handle unhandled requests * refactor(middleware): remove unused type declarations Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* refactor(middleware)!: remove onUnhandledRequest middleware option BREAKING CHANGE: middleware only and (always) handles requests at `path` * fix(doc): document way to handle unhandled requests * refactor(middleware): remove unused type declarations
expected to be merged into
beta
branchWhat?
This PR removes the
onUnhandledRequest
middleware option.Why?
To respect a proposed general rule that all Octokit middlewares (
oauth-app.js
,webhooks.js
,app.js
):pathPrefix
(orpath
) option but provide a natural way for concrete runtimes/frameworks to handle unhandled requestspathPrefix
(orpath
) option (returns404
for unknown routes)But my code relies on the
onUnhandledRequest
option!Because
webhook.js
only exposes a (shared) middleware for Node.js and Express.js middleware currently, the natural way (to handle unhandled requests) is (AFAICT):http.createServer
), check returned boolean value:View rendered README.md